<template>
  <div>
    Bar --- bar title:{{ title }}
    {{ newTitle }}
    <button @click="handleCallParent">call parent</button>
    <button @click="getParent">get parent</button>
  </div>
</template>

<script>
export default {
  props: ["title"],
  data() {
    return {
      newTitle: "",
    };
  },
  methods: {
    getParent() {
      console.log(this.$parent.getName());
    },
    handleCallParent() {
      // this.$emit()
      this.$emit("call-parent");
    },
    setTitle(newTitle) {
      this.newTitle = newTitle;
    },
  },
};
</script>

<style></style>
